*** TABLES 2 AND 5

use "Table_2_5.dta", clear

 
*** TABLE 2 ***
preserve
keep if yr>1983
reghdfe dw_nomd2      ib2.thirdnet             mep_session_count    , a(  start_group   yr ) cl(hoy_id), if yr>1983
outreg2 using Table_2, keep(1.thirdnet 3.thirdnet)  nonotes nocons replace   tex addtext(Political Groups FE, YES, Controls, NO, Ideology, NO )   
reghdfe dw_nomd2 age_martin     female ib2.thirdnet     openlists       mep_session_count    , a(  start_group   yr ) cl(hoy_id)
outreg2 using Table_2, keep(1.thirdnet 3.thirdnet)  nonotes nocons     tex addtext(Political Groups FE, YES, Controls, YES, Ideology, NO)   
reghdfe dw_nomd2 age_martin   dw_nomd1 female ib2.thirdnet    openlists        mep_session_count    , a(   start_group   yr) cl(hoy_id)
outreg2 using Table_2, keep(1.thirdnet 3.thirdnet)  nonotes nocons     tex addtext(Political Groups FE, YES, Controls, YES, Ideology, YES)   
restore
  
*** TABLE 5 ***
preserve
keep if yr>1983
reghdfe com_leader      ib2.thirdnet##eurosceptic             mep_session_count    , a(   start_group    yr ) cl(hoy_id), if yr>1983
outreg2 using Table_5, keep(1.thirdnet 3.thirdnet 1.thirdnet#1.eurosceptic 3.thirdnet#1.eurosceptic)  nonotes nocons replace   tex addtext(Political Groups FE, YES, Controls, NO, Ideology, NO )   
reghdfe com_leader age_martin     female ib2.thirdnet##eurosceptic          openlists       mep_session_count    , a(   start_group    yr ) cl(hoy_id)
outreg2 using Table_5, keep(1.thirdnet 3.thirdnet 1.thirdnet#1.eurosceptic 3.thirdnet#1.eurosceptic)  nonotes nocons     tex addtext(Political Groups FE, YES, Controls, YES, Ideology, NO)   
reghdfe com_leader age_martin   dw_nomd1 female ib2.thirdnet##eurosceptic         openlists        mep_session_count    , a(    start_group    yr) cl(hoy_id)
outreg2 using Table_5, keep(1.thirdnet 3.thirdnet 1.thirdnet#1.eurosceptic 3.thirdnet#1.eurosceptic)  nonotes nocons     tex addtext(Political Groups FE, YES, Controls, YES, Ideology, YES)   
restore

sutex com_leader dw_nomd2 mep_session_count thirdnet  start_group openlists  mep_session_count female  age_martin dw_nomd1 , lab nobs key(descstat) replace   
  
